home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / c / CLib-SDI.lha / CLib-SDI / libsource / libinfo.h < prev    next >
C/C++ Source or Header  |  2002-10-27  |  3KB  |  106 lines

  1. #ifndef EXAMPLE_LIBINFO_H
  2. #define EXAMPLE_LIBINFO_H
  3.  
  4. /* Programmheader
  5.  
  6.     Name:        libinfo.h
  7.     Main:        example
  8.     Versionstring:    $VER: libinfo.h 1.1 (26.09.2002)
  9.     Author:        SDI
  10.     Distribution:    Freeware
  11.     Description:    the example library definition file
  12.  
  13.  1.0   25.06.00 : created that example library code
  14.  1.1   26.09.02 : added MorphOS support and hooks test
  15. */
  16.  
  17. #include <dos/dos.h>
  18. #include <exec/libraries.h>
  19. #include <utility/hooks.h>
  20. #include <SDI_compiler.h>
  21.  
  22. #define VERSION   1
  23. #define REVISION  1
  24. #define DATETXT      "26.09.2002"
  25. #define VERSTXT      "1.1"
  26.  
  27. #define LIBNAME   "example.library"
  28.  
  29. #ifdef _M68060
  30.   #define ADDTXT    " 060"
  31. #elif defined(_M68040)
  32.   #define ADDTXT    " 040"
  33. #elif defined(_M68030)
  34.   #define ADDTXT    " 030"
  35. #elif defined(_M68020)
  36.   #define ADDTXT    " 020"
  37. #elif defined(__MORPHOS__)
  38.   #define ADDTXT    " MorphOS"
  39. #else
  40.   #define ADDTXT    ""
  41. #endif
  42.  
  43. #define IDSTRING "example " VERSTXT " (" DATETXT ")" ADDTXT "\r\n"
  44. /************************************************************************
  45. *                                                *
  46. *    SegList pointer definition                        *
  47. *                                                *
  48. ************************************************************************/
  49.  
  50. #if defined(_AROS)
  51.   typedef struct SegList * SEGLISTPTR;
  52. #elif defined(__VBCC__)
  53.   typedef APTR SEGLISTPTR;
  54. #else
  55.   typedef BPTR SEGLISTPTR;
  56. #endif
  57.  
  58. /************************************************************************
  59. *                                                *
  60. *    library base structure                        *
  61. *                                                *
  62. ************************************************************************/
  63.  
  64. /* This is the private structure. The official one does not contain all
  65. the private fields! */
  66. struct ExampleBaseP {
  67.   struct Library         exb_LibNode;
  68.   UWORD                  exb_Unused;       /* better alignment */
  69.   ULONG                  exb_NumCalls;
  70.   ULONG                  exb_NumHookCalls;
  71.  
  72.   struct ExecBase *      exb_SysBase;
  73.   struct IntuitionBase * exb_IntuitionBase;
  74.   struct UtilityBase *   exb_UtilityBase;
  75.   SEGLISTPTR             exb_SegList;
  76. };
  77.  
  78. #if defined(BASE_GLOABL)
  79.   extern struct ExecBase      * SysBase;
  80.   extern struct IntuitionBase * IntuitionBase;
  81.   extern struct UtilityBase   * UtilityBase;
  82.   extern struct ExampleBase   * ExampleBase;
  83. #elif defined(BASE_REDEFINE)
  84.   #define SysBase       ExampleBase->exb_SysBase
  85.   #define IntuitionBase ExampleBase->exb_IntuitionBase
  86.   #define UtilityBase   ExampleBase->exb_UtilityBase
  87. #endif
  88.  
  89. /************************************************************************
  90. *                                                *
  91. *    library accessable function                    *
  92. *                                                *
  93. ************************************************************************/
  94.  
  95. ASM(LONG) LIBex_TestRequest(REG(a0, UBYTE *title), REG(a1, UBYTE *body),
  96. REG(a2, UBYTE *gadgets), REG(a6, struct ExampleBaseP *ExampleBase));
  97.  
  98. ASM(LONG) LIBex_TestRequest2A(REG(a0, STRPTR title), REG(a1, STRPTR body),
  99. REG(a2, STRPTR gadgets), REG(a3, APTR args),
  100. REG(a6, struct ExampleBaseP *ExampleBase));
  101.  
  102. ASM(ULONG) LIBex_TestRequest3(REG(a0, struct Hook *hook),
  103. REG(a6, struct ExampleBaseP *ExampleBase));
  104.  
  105. #endif /* EXAMPLE_LIBINFO_H */
  106.